// index.js
const { shared, runOnUI, scrollViewContext } = wx.worklet
Page({
  data: {
    animation:{}
  },
  onLoad() {
    this.scrollRef = shared()
    this.createSelectorQuery().select('.scrollable').ref(function(res) {
      this.scrollRef.value = res.ref
    }).exec()
  },
  back(){
    runOnUI(() => {
      'worklet'
      scrollViewContext.scrollTo(this.scrollRef.value, {
        top: 0,
        duration: 2000,
        animated: true,
        easingFunction: 'ease'
      })
    })()
  }
  
})
